package com.httop.api;

import com.alibaba.fastjson.JSON;
import com.httop.model.user.User;
import com.httop.service.CommonService;
import com.httop.service.UserService;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

/**
 * Created by osm_a100 on 2017/5/13.
 */
@Path("/user")
public class UserApi {

    CommonService commonService = new UserService();

    @GET
    @Path("/add/{param}")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public boolean addUser(@PathParam("param") String userJson){
        User user = JSON.parseObject(userJson,User.class);
        commonService.insertEntity(user);
        return true;
    }
}
